// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 获取供应商列表 */
export async function getSupplierList(params: API.User.userPageParam) {
  return request('/api/supplier', {
    method: 'GET',
    params,
  });
}

/** 新增供应商 */
export async function addSupplier(data: API.User.userParam) {
  return request('/api/supplier/addSupplier', {
    method: 'POST',
    data,
  });
}

/** 修改供应商 */
export async function updateSupplier(data: API.User.userParam) {
  return request('/api/supplier/updateSupplier', {
    method: 'POST',
    data,
  });
}

/** 删除供应商 */
export async function deleteSupplier(id: string) {
  return request(`/api/supplier/deleteSupplier`, {
    method: 'delete',
    params: { id },
  });
}

/** 供应商下拉 */
export async function selectSupplier() {
  return request(`/api/supplier/select`, {
    method: 'get',
  });
}
